﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using HR60_PanelSoft.FileUtils;
using HR60_PanelSoft.Model.BaseModel;

namespace HR60_PanelSoft.Model
{
    /// <summary>
    /// 项目
    /// </summary>
	public class Proj
    {
		/// <summary>
		/// 当前项目
		/// </summary>
		public static Proj currentProj = null;

		/// <summary>
		/// 名称
		/// </summary>
		public string name;
		
		/// <summary>
		/// 地址
		/// </summary>
		public string addr;

		/// <summary>
		/// 修改日期
		/// </summary>
		public DateTime date;

		/// <summary>
		/// 作者
		/// </summary>
		public string writer;

		/// <summary>
		/// 默认样式
		/// </summary>
		public UIStyle defaultStyle;

		/// <summary>
		/// 下辖网络信息列表
		/// </summary>
		public List<Net> nets = new List<Net>();

		/// <summary>
		/// 下辖设备分组列表
		/// </summary>
		public List<DeviceGroup> deviceGroups = new List<DeviceGroup>();

		/// <summary>
		/// 场景列表
		/// </summary>
		public List<Scene> scenes = new List<Scene> ();

		/// <summary>
		/// 从文件读取
		/// </summary>
		/// <param name="filePath"></param>
		public void load(string filePath)
		{
			JsonFileUtils.loadProj (this, filePath);
		}

		/// <summary>
		/// 保存到文件
		/// </summary>
		/// <param name="filePath"></param>
		public void save(string filePath)
		{
			JsonFileUtils.saveProj (this, filePath);
		}

    }
}
